home *** CD-ROM | disk | FTP | other *** search
- /*
- File: TInterruptSchedulerExample.h
-
- Contains: Declaration of the TVBLOperation class which is scheduled by a vbl.
- All its process method does is bump up a count of the number of times
- it's been called.
-
- Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __TINTERRUPTSCHEDULEREXAMPLE1__
- #define __TINTERRUPTSCHEDULEREXAMPLE1__
-
- #ifndef __MEMORY__
- #include <memory.h>
- #endif
-
- #ifndef __RETRACE__
- #include <Retrace.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- ///————————————————————————————————————————————————————————————————————————————————————
- /// TVBLOperation
- ///————————————————————————————————————————————————————————————————————————————————————
-
- class TVBLOperation : public TOperation {
- public:
- TVBLOperation(); // Constructor
- virtual ~TVBLOperation(); // Destructor
- virtual void Process(); // Override
- int GetCount();
-
- private:
- int fCount; // number of times called
- };
-
- ///————————————————————————————————————————————————————————————————————————————————————
- /// TVBLOperation IMPLEMENTATION
- ///————————————————————————————————————————————————————————————————————————————————————
-
- TVBLOperation::TVBLOperation()
- {
- fCount = 0;
- }
-
- TVBLOperation::~TVBLOperation()
- {
- }
-
- int TVBLOperation::GetCount()
- {
- return fCount;
- }
-
- // Ok, so this isn't exactly what you expected for a heavy duty process method.
- // Normally if you were doing something so simple you wouldn't schedule an
- // operation for it. Just make beleave fCount++ takes a long time
- void TVBLOperation::Process()
- {
- fCount++;
- }
-
-
- #endif